package com.bugu.entity.customer;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import com.bugu.entity.AuditableEntity;
import com.bugu.entity.IdEntity;
import com.bugu.entity.user.User;
/**
 * 继承了AuditableEntity类，增加了审计功能了，很好的面向横切编程思想
 * @author bugu
 *
 */
@Entity
//表名与类名不相同时重新定义表名.
@Table(name = "company")
//默认的缓存策略.
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class Company extends AuditableEntity {
	private String name = null;
	private String address = null;
	private String tel = null;
	private String fax = null;
	private String nature = null;
	private int scale = 0;
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getTel() {
		return tel;
	}

	public void setTel(String tel) {
		this.tel = tel;
	}

	public String getFax() {
		return fax;
	}

	public void setFax(String fax) {
		this.fax = fax;
	}

	public String getNature() {
		return nature;
	}

	public void setNature(String nature) {
		this.nature = nature;
	}

	public int getScale() {
		return scale;
	}

	public void setScale(int scale) {
		this.scale = scale;
	}
	/**
	 * 以下是实体类
	 */
	private User user = null;
	
	@ManyToOne
	@JoinColumn(name="user_id",nullable=false)
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}
	
	
}
